package practica1;

public class Funcion1 extends FuncionUnaVar{

	public Funcion1(int min, int max, double p) {
		super(min, max, p);
		maximo = 22.3136;
	}

	public boolean maximoAprox(double x){
		double suelo, techo;
		suelo = maximo - 0.001;
		techo = maximo + 0.001;
		return suelo <= x && x <= techo;
	}
	
	public double calcAptitud(double[] f) {
		double x = f[0];
		double e = Math.E;
		return 20 + Math.E - 20*(Math.pow(e,-0.2*x)) - Math.pow(e, Math.cos(2*Math.PI*x));
	}
}
